package com.spring.framework.demo.action;


import com.spring.framework.demo.service.IQueryService;
import com.spring.framework.annotation.LBAutowired;
import com.spring.framework.annotation.LBController;
import com.spring.framework.annotation.LBRequestMapping;
import com.spring.framework.annotation.LBRequestParam;
import com.spring.framework.webmvc.LBModelAndView;

import java.util.HashMap;
import java.util.Map;

/**
 * 公布接口url
 * @author Tom
 *
 */
@LBController
@LBRequestMapping("/")
public class PageAction {

	@LBAutowired
    IQueryService queryService;

	@LBRequestMapping("/first.html")
	public LBModelAndView query(@LBRequestParam("teacher") String teacher){
		String result = queryService.query(teacher);
		Map<String,Object> model = new HashMap<String,Object>();
		model.put("teacher", teacher);
		model.put("data", result);
		model.put("token", "123456");
		return new LBModelAndView("first.html",model);
	}

}
